﻿<!DOCTYPE html>
<html lang="en-us">
 
  <head>
    <meta charset="utf-8">
    <title>雷音集团</title>
    <style>
      html {
        box-sizing: border-box;
      }
      *, *:before, *:after {
        box-sizing: inherit;
      }
      body {
        margin: 0;
      }
      #gameContainer {
        width: 100vw;
        height: 100vh;
      }
      canvas {
        width: 100%;
        height: 100%;
        display: block;
      }
 
      .logo {
          display: block;
          width: max-width: 80vw;
          height: max-height: 60vh;
      }
 
      .progress {
          margin: 1.5em;
          border: 1px solid white;
          width: 50vw;
          display: none;
      }
      .progress .full {
          margin: 2px;
          background: white;
          height: 1em;
          transform-origin: top left;
      }
 
      #loader {
        position: absolute;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
      }
 
      .spinner,
      .spinner:after {
        border-radius: 50%;
        width: 5em;
        height: 5em;
      }
      .spinner {
        margin: 10px;
        font-size: 10px;
        position: relative;
        text-indent: -9999em;
        border-top: 1.1em solid rgba(255, 255, 255, 0.2);
        border-right: 1.1em solid rgba(255, 255, 255, 0.2);
        border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
        border-left: 1.1em solid #ffffff;
        transform: translateZ(0);
        animation: spinner-spin 1.1s infinite linear;
      }
      @keyframes spinner-spin {
        0% {
          transform: rotate(0deg);
        }
        100% {
          transform: rotate(360deg);
        }
      }


      #center {
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -10%;
        margin-left: -75px;
        width: 150px;
        height: 80px;
        font-family: "Lato", sans-serif;
        font-weight: 400;
        font-size: 16px;
        color: #fff;
        text-align: center;
        -webkit-font-smoothing: antialiased;
      }

      .skype-loader {
        width: 80px;
        height: 80px;
        position: relative;
        margin: auto;
        margin-top: 60px;
        margin-bottom: 70px;
      }

      .skype-loader .dot {
        position: absolute;
        top: 0;
        left: 0;
        width: 80px;
        height: 80px;

        animation: 1.7s dotrotate cubic-bezier(0.775, 0.005, 0.310, 1.000) infinite;
      }

      .skype-loader .dot:nth-child(1) {
        animation-delay: 0.2s;
      }

      .skype-loader .dot:nth-child(2) {
        animation-delay: 0.35s;
      }

      .skype-loader .dot:nth-child(3) {
        animation-delay: 0.45s;
      }

      .skype-loader .dot:nth-child(4) {
        animation-delay: 0.55s;
      }

      .skype-loader .dot:after, .skype-loader .dot .first {
        content: "";
        position: absolute;
        width: 8px;
        height: 8px;
        background: white;
        border-radius: 50%;
        left: 50%;
        margin-left: -4px;
      }

      .skype-loader .dot .first {
        background: #fff;
        margin-top: -4px;
        animation: 1.7s dotscale cubic-bezier(0.775, 0.005, 0.310, 1.000) infinite;
        animation-delay: 0.2s;
      }

      @keyframes dotrotate { 
        from { transform: rotate(0deg); } 
        to { transform: rotate(360deg); }
      }

      @keyframes dotscale { 
        0%, 10% { width: 16px; height: 16px; margin-left: -8px;  margin-top: -4px; } 
        50% { width: 8px; height: 8px; margin-left: -4px; margin-top: 0; }
        90%, 100% { width: 16px; height: 16px;  margin-left: -8px;  margin-top: -4px; }
      }
 
    </style>
  </head>
 
  <body>
    <div id="gameContainer"></div>
    <div id="loader">
        
       <div id="center">
        <div class="skype-loader">
          <div class="dot">
            <div class="first"></div>
          </div>
          <div class="dot"></div>
          <div class="dot"></div>
          <div class="dot"></div>
        </div>
        <div id="mProgress" style="font-size: 15px;color:#fff;float: left;margin-top: -120px;margin-left: 60px;"></div>
        <div style="font-family:yahei;font-size: 16px;letter-spacing: 2px">
          加载中，请稍后...
        </div>
      </div>

      <div class="spinner"></div>
      <div class="progress"><div class="full"></div></div>
    </div>
  </body>
 
  <script src="Build/UnityLoader.js"></script>
  <script>
  var gameInstance = UnityLoader.instantiate("gameContainer", "Build/Web.json", {onProgress: UnityProgress});
  function UnityProgress(gameInstance, progress) {
    if (!gameInstance.Module) {
      return;
    }
    const loader = document.querySelector("#loader");
    if (!gameInstance.progress) {
      const progress = document.querySelector("#loader .progress");
      progress.style.display = "none";
      gameInstance.progress = progress.querySelector(".full");
      loader.querySelector(".spinner").style.display = "none";
    }
    gameInstance.progress.style.transform = `scaleX(${progress})`;
    var a=  gameInstance.progress.style.transform;
    document.getElementById("mProgress").innerHTML =  parseInt(a.substring(7,a.length-1)*100)+"%";
    if (progress === 1 ) {
     
          loader.style.display = "none";
     
    }
  }
  </script>
 
</html>
